﻿package Message.Game
{
    import Framework.Serialize.*;
    import Message.Public.*;

    public class SMail extends Object
    {
        public var mailId:Number;
        public var fromPlayerId:int;
        public var fromPlayerName:String;
        public var toPlayerId:int;
        public var toPlayerName:String;
        public var title:String;
        public var content:String;
        public var attachmentCoin:int;
        public var attachmentGold:int;
        public var mailDt:Date;
        public var type:int;
        public var status:int;
        public var hadAttachment:int;
        public var playerItems:Array;

        public function SMail()
        {
            return;
        }// end function

        public function __write(param1:SerializeStream) : void
        {
            param1.writeLong(this.mailId);
            param1.writeInt(this.fromPlayerId);
            param1.writeString(this.fromPlayerName);
            param1.writeInt(this.toPlayerId);
            param1.writeString(this.toPlayerName);
            param1.writeString(this.title);
            param1.writeString(this.content);
            param1.writeInt(this.attachmentCoin);
            param1.writeInt(this.attachmentGold);
            param1.writeDate(this.mailDt);
            param1.writeInt(this.type);
            param1.writeInt(this.status);
            param1.writeInt(this.hadAttachment);
            SeqPlayerItemHelper.write(param1, this.playerItems);
            return;
        }// end function

        public function __read(param1:SerializeStream) : void
        {
            this.mailId = param1.readLong();
            this.fromPlayerId = param1.readInt();
            this.fromPlayerName = param1.readString();
            this.toPlayerId = param1.readInt();
            this.toPlayerName = param1.readString();
            this.title = param1.readString();
            this.content = param1.readString();
            this.attachmentCoin = param1.readInt();
            this.attachmentGold = param1.readInt();
            this.mailDt = param1.readDate();
            this.type = param1.readInt();
            this.status = param1.readInt();
            this.hadAttachment = param1.readInt();
            this.playerItems = SeqPlayerItemHelper.read(param1);
            return;
        }// end function

    }
}
